import java.util.Deque;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;

public class test {
    public static void main(String[] args) {
        MyQueue myQueue = new MyQueue();
        myQueue.offer(1);
        myQueue.offer(2);
        myQueue.offer(3);
        myQueue.offer(4);
        //4321
        System.out.println(myQueue.poll());
        System.out.println(myQueue.poll());
        System.out.println(myQueue.poll());
        System.out.println(myQueue.poll());
    }
    public static void main3(String[] args) {
        Queue<Integer> queue1 = new LinkedList<>();//单向队列
        Deque<Integer> queue2 = new LinkedList<>();//双端队列
        queue1.offer(1);
        queue1.offer(2);
        queue1.offer(3);//从队尾入队列
        System.out.println(queue1.poll());//从队头出队列
        System.out.println(queue1.peek());//看一眼队头元素
        System.out.println(queue1.isEmpty());//判断队列是否为空
    }
    public static void main2(String[] args) {
        MyStack myStack = new MyStack();
        myStack.push(1);
        myStack.push(2);
        myStack.push(3);
        System.out.println(myStack.peek());
        System.out.println(myStack.pop());
        System.out.println(myStack.pop());
        System.out.println(myStack.pop());
        System.out.println(myStack.isEmpty());
    }




    public static void main1(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(12);
        stack.push(23);
        stack.push(34);
        System.out.println(stack.peek());//看一下栈顶的元素但是不删除
        System.out.println(stack.pop());//删除栈顶元素
        System.out.println(stack.peek());//看一下栈顶的元素但是不删除
        System.out.println(stack.isEmpty());//判断栈是否为空
        System.out.println(stack.size());//栈中元素个数
    }
}
